Error: Run Time Error 51 Microsoft Word--This task is... (due to mail merges).
Error:
Run Time Error 51 Microsoft Word--This task is taking longer than expected. Do you want to continue waiting?
Cause:
OLE is processing the mail merges too slowly.
Solution:
Save the Excel worksheet as a Word document and use it as the data source.
1) Save the Excel worksheet as a Word document:
a) In Excel, select the 'File' menu and select 'Save As...'.
b) In the 'Files of Type' drop-down list box, select 'Word Document'.
c) Type a filename in the 'File name' drop-down list box.
d) Click 'OK'.
2) Use this file as the data source:
NOTE: The Excel database MUST be created BEFORE beginning this procedure.
a) Select the 'Tools' menu and select 'Mail Merge...'. (The Mail Merge Helper dialog box appears.)
Mail Merge Helper
b) Click 'Create' from the 'Main Document' group.
c) Select 'Form Letters' from the 'Main Document' drop-down menu.
Main Document drop-down menu
d) Click 'Active Window' to use the currently active document as the main document.
e) Click 'Get Data' from the 'Data Source' group.
Data Source drop-down menu
f) Select 'Open Data Source...'. (The Open Data Source dialog box appears.)
Open Data Source
g) Select 'MS Excel Worksheets (*.XLS)' from the 'List Files of Type' list box.
List Files of Type
h) Select the appropriate drive and directory.
i) Select the filename from the desired Excel worksheet from the 'File Name' list box.
j) Click 'Open'. (The dialog box appears.)
k) Select 'MS Excel Worksheets via DDE (*.XLS)'. (The Microsoft Excel dialog box appears.)
l) Select 'Entire Spreadsheet' from the 'Named or Cell Range' box.
m) Click 'OK'. (The Microsoft Word dialog box appears.)
n) Click 'Edit Main Document'. (The Database toolbar appears.)
o) Type the form letter.
p) Insert merge fields:
1] Click in the main document where the merge field is to be inserted.
2] Click 'Insert Merge Field' from the 'Mail Merge' toolbar. (A drop-down list appears.)
3] Select the desired field to be inserted. (The merge field appears in the main document.)
NOTE: Word displays merge fields with brackets.
EXAMPLE: Dear Mr. <<Last Name>>
4] Repeat steps 2)p)1] through 2)p)3] for each field to be inserted.
q) Merge the main document and the data source:
1] Select the 'Tools' menu and select 'Mail Merge...'. (The MailMerge helper dialog box appears.)
2] Click 'Merge...' from the 'Merge the Data with the Document' group. (The Merge dialog box appears.)
3] Select 'New Document' from the 'Merge To' drop down list.
4] Click 'Merge'.
NOTE: Word creates a new document that contains one complete copy of the main document for each record in the data source, with data from the data source substituted for each merge field. The merged copies are separated from one another by section breaks.